# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.IdentityToolkit.V3.Model.Relyingparty do
  @moduledoc """
  Request of getting a code for user confirmation (reset password, change email etc.)

  ## Attributes

  *   `androidInstallApp` (*type:* `boolean()`, *default:* `nil`) - whether or not to install the android app on the device where the link is opened
  *   `androidMinimumVersion` (*type:* `String.t`, *default:* `nil`) - minimum version of the app. if the version on the device is lower than this version then the user is taken to the play store to upgrade the app
  *   `androidPackageName` (*type:* `String.t`, *default:* `nil`) - android package name of the android app to handle the action code
  *   `canHandleCodeInApp` (*type:* `boolean()`, *default:* `nil`) - whether or not the app can handle the oob code without first going to web
  *   `captchaResp` (*type:* `String.t`, *default:* `nil`) - The recaptcha response from the user.
  *   `challenge` (*type:* `String.t`, *default:* `nil`) - The recaptcha challenge presented to the user.
  *   `continueUrl` (*type:* `String.t`, *default:* `nil`) - The url to continue to the Gitkit app
  *   `email` (*type:* `String.t`, *default:* `nil`) - The email of the user.
  *   `iOSAppStoreId` (*type:* `String.t`, *default:* `nil`) - iOS app store id to download the app if it's not already installed
  *   `iOSBundleId` (*type:* `String.t`, *default:* `nil`) - the iOS bundle id of iOS app to handle the action code
  *   `idToken` (*type:* `String.t`, *default:* `nil`) - The user's Gitkit login token for email change.
  *   `kind` (*type:* `String.t`, *default:* `identitytoolkit#relyingparty`) - The fixed string "identitytoolkit#relyingparty".
  *   `newEmail` (*type:* `String.t`, *default:* `nil`) - The new email if the code is for email change.
  *   `requestType` (*type:* `String.t`, *default:* `nil`) - The request type.
  *   `userIp` (*type:* `String.t`, *default:* `nil`) - The IP address of the user.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :androidInstallApp => boolean() | nil,
          :androidMinimumVersion => String.t() | nil,
          :androidPackageName => String.t() | nil,
          :canHandleCodeInApp => boolean() | nil,
          :captchaResp => String.t() | nil,
          :challenge => String.t() | nil,
          :continueUrl => String.t() | nil,
          :email => String.t() | nil,
          :iOSAppStoreId => String.t() | nil,
          :iOSBundleId => String.t() | nil,
          :idToken => String.t() | nil,
          :kind => String.t() | nil,
          :newEmail => String.t() | nil,
          :requestType => String.t() | nil,
          :userIp => String.t() | nil
        }

  field(:androidInstallApp)
  field(:androidMinimumVersion)
  field(:androidPackageName)
  field(:canHandleCodeInApp)
  field(:captchaResp)
  field(:challenge)
  field(:continueUrl)
  field(:email)
  field(:iOSAppStoreId)
  field(:iOSBundleId)
  field(:idToken)
  field(:kind)
  field(:newEmail)
  field(:requestType)
  field(:userIp)
end

defimpl Poison.Decoder, for: GoogleApi.IdentityToolkit.V3.Model.Relyingparty do
  def decode(value, options) do
    GoogleApi.IdentityToolkit.V3.Model.Relyingparty.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.IdentityToolkit.V3.Model.Relyingparty do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
